/**
地址显示组件

属性
  value:{code:String,addre:String}  其中code需要完整代码，例如：行政区划：150302
 */
<template>
  <span>
    <DistXZQH :code="code"></DistXZQH>&nbsp;<span>{{addre}}</span>
  </span>
</template>

<script>
import DistXZQH from './DistXZQH'
export default {
  components:{DistXZQH},
  props:{
    value:Object
  },
  data(){
    return {
      code:'',
      addre:''    }
  },
  mounted(){
    if (typeof this.value != 'undefined'){
      if (this.value.hasOwnProperty('code')){
        this.code = this.value.code
      }
      if (this.value.hasOwnProperty('addre')){
        this.addre = this.value.addre
      }
    }
  },
  watch:{
    value(val){
      if (typeof val != 'undefined'){
        this.code = val.code
        this.addre = val.addre
      }
    }
  }
}
</script>